@echo off

set SOURCE_FOLDER=.

set CS_COMPILER_PATH=protoc.exe

set CS_TARGET_PATH=..\..\Test

for /f "delims=" %%i in ('dir /b "%SOURCE_FOLDER%\*.proto"') do (
    ::delet old
    del %CS_TARGET_PATH%\%%~ni.* /f /s /q

    ::gen new
    echo %CS_COMPILER_PATH% --csharp_out=%CS_TARGET_PATH% %%i
    %CS_COMPILER_PATH% --csharp_out=%CS_TARGET_PATH% %%i
)

echo compile finish!

pause
